﻿<Selection:SelectControl x:Class="jSLApp.Client.Forms.FileList"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Selection="clr-namespace:jSLCore.Client.Presentation.BaseControl.Selection;assembly=jSLCore.Client.Presentation" xmlns:j="clr-namespace:jSLCore.Client.Presentation.Controls;assembly=jSLCore.Client.Presentation" xmlns:sel="clr-namespace:jSLCore.Client.Presentation.Wpf.TelerikSupport.Selection;assembly=jSLCore.Client.Presentation.Telerik" xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" xmlns:Converters="clr-namespace:jSLApp.Client.Converters" xmlns:Controls1="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" xmlns:Columns="clr-namespace:jSLCore.Client.Presentation.Wpf.TelerikSupport.Selection.Columns;assembly=jSLCore.Client.Presentation.Telerik" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <j:ImageGroupBox>
    	<j:ImageGroupBox.Header>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="Свободные файлы"/>
                <Button Content="Обновить" Name="refreshButton" Click="refresh_Clicked"/>
                <Button Content="Закачать" Click="upload_Clicked"/>
            </StackPanel>            
        </j:ImageGroupBox.Header>
        <sel:jSLRadGrid x:Name="grid" FrozenColumnCount="1" GoDetailsClick="showFile_Clicked">
            <sel:jSLRadGrid.Columns>               
                <sel:ImageButtonColumn ButtonImage="../Resources/delete.png" ButtonTooltip="Удалить" Click="delete_Clicked"/>
                <Controls:GridViewDataColumn >
                    <Controls:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <Image Width="16" Height="16" Source="../Resources/Favorites.png">
                                <Image.Visibility>
                                    <Binding Path="JustLoaded">
                                        <Binding.Converter>
                                            <Controls1:BooleanToVisibilityConverter/>
                                        </Binding.Converter>
                                    </Binding>
                                </Image.Visibility>
                            </Image>
                        </DataTemplate>
                    </Controls:GridViewDataColumn.CellTemplate>
                </Controls:GridViewDataColumn>
                <Columns:GoDetailsColumn Header="Имя" DataMemberBinding="{Binding Name}"/>
                <Controls:GridViewDataColumn Header="Размер">
                	<Controls:GridViewDataColumn.DataMemberBinding>
                        <Binding Path="Size">
                        	<Binding.Converter>
                        		<Converters:SizeConverter/>
                        	</Binding.Converter>
                        </Binding>
                	</Controls:GridViewDataColumn.DataMemberBinding>
                </Controls:GridViewDataColumn>
            </sel:jSLRadGrid.Columns>
        </sel:jSLRadGrid>
    </j:ImageGroupBox>
</Selection:SelectControl>